-
Notifications
You must be signed in to change notification settings - Fork 280
DOC-4997 hiredis async API and integration examples #1362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dwdougherty
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question re. the copying of headers. Otherwise, language LGTM.
| Build `hiredis` if you have not already done so (see | ||
| [Build and install]({{< relref "/develop/clients/hiredis#build-and-install" >}}) | ||
| for more information). Copy the following files from the `hiredis` folder into | ||
| the Header files section of your Qt project: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious... wouldn't there be a standard place where these header files get installed after running make install? Seems a bit odd to be copying header files like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I thought that too. I assumed if you wrote #include <xxx.h> it would find the file if you had installed it but I got an error when I tried to do that (it specifically said 'try using "" includes instead of <>". I should try to investigate this further before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The C standard leaves the process for finding files #include'd up to the implementation. But GCC's documentation describes it well, and I would be suprised if any compiler did it differently [1]. Basically, #include <hiredis.h> will look through the systems include directories or any directory passed through the -I argument. Using #include "hiredis.h" will do the same thing if the header cannot be found in directory containing the source file that includes it.
[1] https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Search-Path.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed the header lines and the corresponding advice in the text. Thanks @dwdougherty and @collinfunk for your help with this :-)
DOC-4997
This adds info about async connections and commands and also examples of using Qt and libevent in your app.
I'm wondering if it would also be a good idea to have an example of a simple RAII C++ class (connects to Redis synchronously in the constructor, disconnects in the destructor, couple of command methods, etc). I'm happy to add this if it would be useful, but it might not be a good idea if we've got plans for a proper C++ integration in the near future. Best not to confuse people :-)